package com.whfc.emp.dao;

import com.whfc.emp.entity.ReportReceiver;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 日报接收记录Mapper，定义数据库操作方法
 */
public interface ReportReceiverMapper {
    // 基础CRUD
    int insert(ReportReceiver record);
    int insertSelective(ReportReceiver record);
    ReportReceiver selectByPrimaryKey(Long id);
    int updateByPrimaryKeySelective(ReportReceiver record);
    int updateByPrimaryKey(ReportReceiver record);
    int deleteByPrimaryKey(Long id);

    // 业务查询：按日报ID查询接收记录
    List<ReportReceiver> selectByReportId(@Param("reportId") Long reportId);
    // 业务查询：按接收人ID和阅读状态查询
    List<ReportReceiver> selectByReceiver(Map<String, Object> params);
    // 业务更新：修改阅读状态
    int updateReadStatus(@Param("reportId") Long reportId, @Param("receiver") Long receiver, @Param("readStatus") Integer readStatus);
}